import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/home'
import Login from '@/components/login'
import Register from '@/components/register'
import Detail from '@/components/detail'
import MyMessage from '@/components/mymessage'
import MyOrder from '@/components/myorder'
import MyStore from '@/components/mystore'
import SelectMess from '@/components/selectmess'
import ADhome from '@/components/administrator/ADhome'
import ADmessage from '@/components/administrator/ADmessage'
import ADnotice from '@/components/administrator/ADnotice'
import ADselect from '@/components/administrator/ADselect'
import ADslideshow from '@/components/administrator/ADslideshow'

Vue.use(Router)

export default new Router({
  mode: 'hash',
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/register',
      name: 'register',
      component: Register
    },
    {
      path: '/detail',
      name: 'detail',
      component: Detail
    },
    {
      path: '/mymessage',
      name: 'mymessage',
      component: MyMessage
    },
    {
      path: '/myorder',
      name: 'myorder',
      component: MyOrder
    },
    {
      path: '/mystore',
      name: 'mystore',
      component: MyStore
    },
    {
      path: '/selectmess',
      name: 'selectmess',
      component: SelectMess
    },
    {
      path: '/ADhome',
      name: 'ADhome',
      component: ADhome,
      children: [
        {
          path: '/ADmessage',
          name: 'ADmessage',
          component: ADmessage
        },
        {
          path: '/ADnotice',
          name: 'ADnotice',
          component: ADnotice
        },
        {
          path: '/ADselect',
          name: 'ADselect',
          component: ADselect
        },
        {
          path: '/ADslideshow',
          name: 'ADslideshow',
          component: ADslideshow
        }
      ]
    }
  ]
})
